<?php

$name = isset($select)? $select : '';

?>
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>新增会员</title>
    <include file="../simpleboot3/public@function"/>
    <script src="__TMPL__/public/assets/js/jquery-1.10.2.min.js"></script>
    <script src="__STATIC__/js/layer/layer.js"></script>
    <style type="text/css">
	body,input{ font-family:"微软雅黑";}
        input{margin:10px 10px 10px 10px;
    border-radius: 5px;
    height: 40px;
    width: 260px;
    border: solid 1px #57b99f;}
	select{margin:10px 10px 10px 10px;    border-radius: 5px;
    height: 40px;
    width: 260px;
    border: solid 1px #57b99f;}
	.layui-layer-title{
		background-color:#57b99f;
	}
    </style>
</head>
<body style="background: rgba(28, 109, 42, 0.19)">
<form method="post" name="form2" id="form2" action="{:url('member/memadd')}">
<div style=" width:870px; height:100%; margin:0 auto; color:#000000;">
    卡面卡号: <input type="text" name="card_id" value="" id="card_id"><br>
    会员姓名: <input type="text" name="uname" id="uname" value="">&nbsp;<br />
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;性别: <select name="sex" id="sex">
    
    <option value="1">男</option>
    <option value="2">女</option>
    </select><br>
    手机号码: <input type="tel" name="mobile" id="mobile"><br>
    会员密码: <input type="password" name="pasword"  id="pasword"><br>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;生日: <input type="date" name="" id="date"><br>
    <input type="button" value="确定"  style="height: 45px;width: 155px; background:#57b99f; color:#fff; font-size:16px; cursor:pointer" id="sub"/>
    <input type="button" value="重置" style="height: 45px;width: 155px;  background:#57b99f; color:#fff;font-size:16px; cursor:pointer" id="#btn_cancel"  onclick="cz()"/>
    </div>
</form>
</body>
</html>
<script>
    function cz(){
    	document.location.href="../member/memadd";
    }
    $('#sub').click(function()
    {
        var card_id=$('#card_id').val();
        var uname=$('#uname').val();
        var date=$('#date').val();
        var mobile=$('#mobile').val();
        var zz=/^(0|86|17951)?(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$/;
        var pd=zz.test(mobile);
        if(pd ==false)
        {
            alert('您好！请填写正确的手机号');
            return false;
        }
        var pasword=$('#pasword').val();
        var sex=$('#sex').val();
        var index = parent.layer.getFrameIndex(window.name); //获取当前窗体索引
        $.post("{:url('member/memadd')}",{card_id:card_id,uname:uname,date:date,mobile:mobile,sex:sex,pasword:pasword},function(date){
            var status=date.msg.status;
            if(status == 1)
            {
                alert(date.msg.con);
                parent.layer.close(index); //执行关闭
            }else{
                alert(date.msg.con);
            }

        },'json');
    })
</script>
